<?php
/**
 * CEOfox
 *
 * @copyright  Copyright 2011-2012 CEOfox, Inc.
 * @license    http://ceofox.com/pages/license
 * @version    $Id: following.html.php 87089 2013-05-24 09:40:17 $
 * @author     CEOfox, Inc.
 */
?>
<?php
  defined('PHPFOX') or exit('NO DICE!');
?>

{if isset($aFollowings) && count($aFollowings)}
    {if !PHPFOX_IS_AJAX}
        <div id="following_{$sType}" {if $sFullControllerName == 'follow.index'}style="display: none;"{/if}>    
        <div class="table_header">{phrase var='follow.following'}</div>
    {/if}
    {foreach from=$aFollowings item=aFollowing name=following}        
    <div id="js_following_{$aFollowing.user_id}" class="following_row_holder js_selector_class_{$aFollowing.user_id} {if is_int($phpfox.iteration.following/2)}row1{else}row2{/if}{if $phpfox.iteration.following == 1 && !PHPFOX_IS_AJAX} row_first{/if}">
        <div class="friend_image" id="js_image_div_{$aFollowing.user_id}">    
            {img id='sJsUserImage_'$aFollowing.user_id'' user=$aFollowing suffix='_50_square' max_width=50 max_height=50}
        </div>
        <div class="friend_user_name">
            {$aFollowing|user:'':'':50} 
        </div>
        {if isset($bIsCurrentUser) && $bIsCurrentUser && Phpfox::isUser()}
                <a class="follow-inline-btn unfollow_{$sType}_{$aFollowing.user_id}" href="{url link='follow.del' id=Phpfox::getUserId() type=$sType oid=$aFollowing.user_id}"><span class="following follow-button follow-text" style="float:right" onmouseover="$Core.follow.changeText();">
                {phrase var='follow.following'}</span></a>
                <a style="display:none;" class="follow-inline-btn follow_{$sType}_{$aFollowing.user_id}" href="{url link='follow.add' id=Phpfox::getUserId() type=$sType oid=$aFollowing.user_id}"><span class="following follow-button" style="float:right">
                {phrase var='follow.follow'}</span></a>
        {/if}
        {if !$aFollowing.isFollow && $aFollowing.canFollow &&  Phpfox::isUser()}
                <a class="follow-inline-btn follow_{$sType}_{$aFollowing.user_id}" href="{url link='follow.add' id=Phpfox::getUserId() type=$sType oid=$aFollowing.user_id}"><span class="follow follow-button" style="float:right">
                {phrase var='follow.follow'}</span></a>       
                <a style="display:none;" class="follow-inline-btn unfollow_{$sType}_{$aFollowing.user_id}" href="{url link='follow.del' id=Phpfox::getUserId() type=$sType oid=$aFollowing.user_id}"><span class="following follow-button" style="float:right" onmouseover="$Core.follow.changeText();">
                {phrase var='follow.following'}</span></a>             
        {/if}
    </div>
{/foreach}
</div>
    {if !PHPFOX_IS_AJAX}
        {if $iCurrentFollowing < $iTotalFollowing}
            <div id="js_pager_view_more_link_{$sBlockType}" class="js_pager_view_more_link" {if $sFullControllerName == 'follow.index'}style="display:none;"{/if}>
                <div class="pager_view_more_holder">
                    <div class="feed_view_more">
                    <input id="follow_page_view_following" type="hidden" name="page" value="2">
                    <input id="current_following" type="hidden" value="{$iCurrentFollowing}">
                    <input id="total_following" type="hidden" value="{$iTotalFollowing}">
                    <input id="follow_page_item_id" type="hidden" name="user_id" value="{$aUser.user_id}">
                    <input id="follow_module_id" type="hidden" name="follow_module_id" value={$sType}>
                    <a class="global_view_mores no_ajax_link" href="#" onclick="$Core.follow.viewMore('following');return false;">{phrase var='follow.view_more'}</a>
                    </div>
                </div>
            </div>
        {/if}
    {/if}
{/if}

{if PHPFOX_IS_AJAX}
    <script type="text/javascript">
        $Core.follow.updateCurrent('{$sBlockType}', {$iCurrentFollowing});
        $Core.follow.setPage('{$iPage}','{$sBlockType}');
    </script>
{/if}

